package com.example.springboottest.config;

import com.example.springboottest.aop.WebLogAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(WebLogProperties.class)
@ConditionalOnProperty(prefix = "web", value = "enable", havingValue = "true")
public class WebLogConfig {

    @Bean
    public WebLogAspect getWebLogAspect(){
        return new WebLogAspect();
    }

}
